package com.dawnling.waveview;

import android.graphics.Paint;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    private CircleWaveView mCircleWaveView;
    private SeismicWaveView seismicWaveView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        seismicWaveView = (SeismicWaveView) findViewById(R.id.seismicwaveview);
        seismicWaveView.start();
        mCircleWaveView = (CircleWaveView) findViewById(R.id.wave_view);
        //暂停动画
        mCircleWaveView.postDelayed(new Runnable() {
            @Override
            public void run() {
//                mCircleWaveView.stop();
            }
        }, 5000);


        //空心圆
        /*mWaveView.setDuration(5000);
        mWaveView.setStyle(Paint.Style.STROKE);
        mWaveView.setSpeed(400);
        mWaveView.setColor(Color.RED);
        mWaveView.setInterpolator(new AccelerateInterpolator(1.2f));
        mWaveView.start();*/

        //实心圆
        mCircleWaveView.setDuration(5000);
        mCircleWaveView.setStyle(Paint.Style.FILL);
        mCircleWaveView.setColor(getResources().getColor(R.color.colorPrimary));
        mCircleWaveView.setInterpolator(new LinearOutSlowInInterpolator());
        mCircleWaveView.setMaxRadius(220);
        mCircleWaveView.start();
    }
}
